package myannotion.springmvc.controller;

import myannotion.springmvc.service.MvcSoucreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @author sss
 * @date 2020-02-19 16:06
 **/
@RestController
public class MvcSoucreController {

    @Autowired
    private MvcSoucreService mvcSoucreService;

    @RequestMapping(value = "/springmvc",method = RequestMethod.GET)
    public String sayHello( User user, @RequestParam String str,Map<String,Object> map){
		System.out.println("执行了*******方法");
        return mvcSoucreService.say();
    }

    @GetMapping("/test")
    public Object sayHello2(){
		Map<String ,Object> map =new HashMap<>();
		map.put("code",200);
		map.put("message","哈哈");
        return map;
    }
}
